package com.simulacra.util;

import java.util.HashMap;

import com.simulacra.model.Team;
import com.simulacra.util.log.Logger;

public class Utilities {
	public static HashMap<String, Double> getTeamData(HashMap<String, Double> data) {
		HashMap<String, Double> returnCollection = null;
		Double content = null;
		returnCollection= new HashMap<String, Double> ();
		if (data != null && (content= data.remove(Team.LOCAL_TEAM)) != null) {
			returnCollection.put(Team.LOCAL_TEAM, content);
			
		}
		if (data != null && (content= data.remove(Team.VISIT_TEAM)) != null) {
			returnCollection.put(Team.VISIT_TEAM, content);
			
		}
		Logger.log(null, returnCollection==null?"null":String.valueOf("size("+ returnCollection.size()+") " ));
		return returnCollection;
		
	}
	public static int getInt(String value) {
		int i= 0;
    	try {
    		i= Integer.parseInt(value);
    	} catch (NumberFormatException error) {
    		i= 0;
    	}
    	return i;
	}

}
